package com.infovane.service.impl;

import java.util.List;

import com.infovane.dao.AdminDao;
import com.infovane.model.TUser;
import com.infovane.service.AdminService;

public class AdminServiceImpl implements AdminService{
	
	private AdminDao adminDao;
	
	
	
	public AdminDao getAdminDao() {
		return adminDao;
	}



	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}



	/**
	 *核对管理员登录用户名与密码
	 *@param username ,password
	 *@return Object
	 **/

	public TUser checkLogin(String username, String password) {
		List<TUser> userList=null;
		String hql="from TUser as u where u.userName=:userName and u.userPass=:userPass";
		userList=this.adminDao.load(hql, username, password);
		if(userList.size()>0){
			return userList.get(0);
		}
		return null;
	}
	
	

	

}
